Skip to content

TOC-As-1

Question 1

a.Z×Z is countable.

Construct a counting procedure as below:

1-a-counting-procedure

Each pair corresponds to a unique natural number. Therefore Z×Z is countalbe

b.If set S is countable and n is a natural number constant, then Sn is countable.

Case I

If S is a finite set with m element;

Then |Sn|=mn which is finite. Therefore Sn is countable.

Case 2

If S is a infinite and countable set; Then there must be a bijection between S and N.

And for 2 countable sets A B, A×B is also a countable set.

For any element (a,b)A×B , we can write a=f(i) and b=g(j) for some i,jN.

Therefore, (a,b) corresponds to the pair (f(i),g(j)) , which in turn corresponds to the natural number pair (i,j).

To establish a one-to-one correspondence, we can use a pairing function that maps each pair (i,j) to a unique natural number k .

k=(i+j)(i+j+1)2+j

Therefore, A×B is countable.

Since Sn=S×S××S n times.

And S×S is countable.

Therefore Sn is countable.

c.|{a|aR0<a<1}|=R

Solution:

Bijection |{a|aR0<a<1}|R:tan(πxπ2)

Solution

d.{a|aR0<a<10} is uncountable.

Suppose a real number ai(0,10) denote as ai=ai,1ai,2. Then we build the table as below:

IndexanDigits
0a0a0,0 a0,1 a0,2
1a1a1,0 a1,1 a1,2
2a2a2,0 a2,1 a2,2

Next we define a real number ax=ax,0ax,1 such that ax,i=(ai,i+2)mod 10. We can see a xis not in the list!

  • ax and a0 are different at digit 0.
  • ax and a1 are different at digit 1.
  • ax and a2 are different at digit 2.
  • ax and a3 are different at digit 3.

Thus, ax is not counted and set of reals in (0, 10) is uncountable.

{f|f:N{0,1}} is uncountable

Assume that the set of functions from N to {0,1} is countable.

Suppose all such functions can be listed as f1,f2,f3,.

Define a function g such that g(n)=1fn(n). This ensures that g differs from each fi at least at position i.

Since g is not equal to any fi in the list, this contradicts the assumption that we have listed all possible functions.

Therefore, the set of functions from N to {0,1} is uncountable.

Question 2

Prove the followings.(1 pt for each)

a

For a given alphabet Σ, the number of DFA over Σ is countable

b

Two sets are isomorphic if they are of the same cardinality. Prove that the number of DFA's (without specifying Σ) is countable up to set isomorphism.

Question 3

Let Σ={a,b}. Construct a DFA for each of the following languages. (10 pt for each)

a. {w|w has at least one a}

Current Stateab
q0q1q0
q1q1q1
3-a-DFA

b. {w|w has no more than three as}

Current Stateab
q0q1q1
q1q2q1
q2q3q2
q3q4q3
q4q4q4
3-b-DFA

c. {w|w does not have ab as a substring}

Current Stateab
q0q1q2
q1q1q3
q2q1q2
q3q3q3
3-c-DFA

d. {w|w contains no runs of length less than for}. A run in a string is a substring of length at least one and consisting entirely of the same symbol. For example, abbbaab has four runs: a,bbb,aa,b.

Current Stateab
q0q1q2
q1q3q9
q2q10q4
q3q5q9
q4q10q6
q5q7q9
q6q10q8
q7q7q2
q8q1q8
q9q9q9
q10q10q10
3-d-DFA

Question 4

Let M=(Q,Σ,δ,q0,F) be an arbitrary DFA. We construct a new DFA M as M=(Q,Σ,δ,q0,QF). We need to prove that L(M)=L(M).

Note:

  • QF is the set difference.
  • L(M)=ΣL(M) is the set complement.

The goal L(M)=L(M) is understood as set equality.
Thus, we need to prove wΣ, wL(M)wL(M).

()
Assume wL(M).
Then wL(M).
Thus, DFA M rejects w.
In other words, DFA M halts on a non-final state qx by consuming all symbols in w.
By the construction of M, qx is a final state of M.
Thus, M accepts w, and wL(M).


()
Assume wL(M).
DFA M accepts w.
In other words, DFA M halts on a final state qy by consuming all symbols in w.
By the construction of M, qy is a non-final state of M.
Thus, M rejects w, so wL(M).
Thus, wL(M). L(M)=L(M).